
//TODO a(57)
function  a57(module, exports, a) {
    var i = a(23), s = a(3), r = a(21), n = (a(2), function (e) {
        this.contDom = e.dom.cont, this.parentEl = e.dom.parentEl, this.active = e.active
    });
    s.extend(n, i);
    var o = {
        init: function () {
            this.playerData = this.manager.playerData, this.nodes = {
                pannel: this.parentEl.find(".js-pannel"),
                poster: this.parentEl.find(".hv_play_poster"),
                loading: this.parentEl.find(".hv_ico_loading"),
                title: this.parentEl.find(".hv_tit"),
                optDefi: this.parentEl.find(".clear_ul"),
                bigPlayBtn: this.parentEl.find(".hv_ico_pasued"),
                playBtn: this.parentEl.find(".hv_start span"),
                shadow: this.parentEl.find(".js-bg"),
                controlBar: this.parentEl.find(".hv_botbar"),
                topBar: this.parentEl.find(".hv_topbar"),
                barrgeBar: this.parentEl.find(".hv_barrage_cmt")
            }, this.autoHideTime = null, this.delayTime = null, this.showLoadingTime = null, this.isPcFullscreen = !1, this.isShowInputBar = !1, this.fixed = !1, this.isShowBarrageBtn = !1, this.addEvent()
        }, addEvent: function () {
            this.manager.listener.on(r.PLAY_STATE, function (e, t) {
                "init" == t ? (this.manager.evt.off("vjs_preparPlay", this.onPreparPlay, this), this.manager.evt.one("vjs_preparPlay", this.onPreparPlay, this), this.nodes.loading[0].style.display = "block", this.nodes.bigPlayBtn[0].style.display = "none", this.hidePannel()) : "stop" == t && this.hidePannel()
            }, this), this.manager.evt.on("vjs_startPlay", this.onStartPlay, this), this.manager.evt.on("vjs_hidePanel", this.hidePannel, this), this.manager.evt.on("vjs_toggleInput", this.toggleBarrgeInput, this), this.manager.evt.on("vjs_vinfoReady", function () {
                this.nodes.title[0] && (this.nodes.title[0].innerHTML = this.playerData.vinfo.title || "");
            }, this), this.nodes.bigPlayBtn.on("click", this.toPlay, this), "PC" == this.playerData.interactiveType ? (this.nodes.pannel.on("click", function (e) {
                    e.target == this.nodes.pannel[0] && ("pause" == this.manager.listener.get(r.PLAY_STATE) ? this.manager.evt.trigger(r.EVENT.PLAYER_COMMAND, "play") : this.manager.evt.trigger(r.EVENT.PLAYER_COMMAND, "pause"))
                }, this), this.nodes.barrgeBar.on("mouseleave", function (e) {
                    this.fixed = !0, setTimeout(s.bind(function () {
                        this.fixed = !1
                    }, this), 1e3)
                }, this), this.parentEl.on("mousemove", function (e) {
                    this.fixed || this.isShowInputBar || "init" == this.manager.listener.get(r.PLAY_STATE) || "stop" == this.manager.listener.get(r.PLAY_STATE) || this.showPannel()
                }, this), this.nodes.shadow.on("click", this.stopPropagation)) : (this.nodes.pannel.on("touchend", this.togglePannel, this), this.nodes.shadow.on("touchend", this.stopPropagation), this.nodes.controlBar.on("touchend", this.showPannel, this)), this.manager.evt.on("vjs_showPannel", this.showPannel, this), this.manager.evt.on("vjs_hideLoading", this.hideLoading, this), this.manager.evt.on("vjs_autoHidePannel", this.autoHidePannel, this), this.manager.evt.on("vjs_timeupdate vjs_pause vjs_p2pBufferend", this.hideLoading, this), this.manager.evt.on("vjs_seeking vjs_waiting vjs_stalled vjs_p2pBufferstart", this.showLoading, this), this.manager.evt.on(r.EVENT.RESIZE, this.onResize, this), this.manager.evt.on("vjs_showbarrageBtn", this.onIsshowBarrageBtn, this)
        }, onIsshowBarrageBtn: function () {
            this.isShowBarrageBtn = !0, this.onResize()
        }, onResize: function () {
            this.isShowBarrageBtn ? this.nodes.title[0].style.width = this.contDom.width() - 100 + "px" : this.nodes.title[0].style.width = this.contDom.width() - 35 + "px"
        }, toPlay: function () {
            this.manager.evt.trigger(r.EVENT.PLAYER_COMMAND, "play")
        }, onStartPlay: function () {
            this.nodes.poster[0].style.display = "none", this.nodes.bigPlayBtn[0].style.display = "none", this.nodes.shadow[0].style.display = "none", this.manager.listener.get(r.IS_AD) || (this.nodes.loading[0].style.display = "block")
        }, onPreparPlay: function () {
            this.nodes.loading[0].style.display = "none", this.nodes.bigPlayBtn[0].style.display = "block"
        }, togglePannel: function (e) {
            e && e.target === this.nodes.pannel[0] && !this.active.isDrag && (this.delayTime ? (clearTimeout(this.delayTime), this.delayTime = null) : this.delayTime = setTimeout(s.bind(function () {
                    this.isShowInputBar || (this.parentEl.hasClass("hv_box_hide") ? (this.parentEl.removeClass("hv_box_hide"), this.manager.evt.trigger("vjs_showInputPannel", !0)) : (this.parentEl.addClass("hv_box_hide"), this.nodes.optDefi.removeClass("hover"), this.manager.evt.trigger("vjs_showInputPannel", !1))), this.autoHidePannel(), this.delayTime = null
                }, this), 200)), this.manager.evt.trigger("vjs_togglePannel")
        }, autoHidePannel: function () {
            clearTimeout(this.autoHideTime), this.autoHideTime = setTimeout(s.bind(function () {
                this.active.isDrag || (this.parentEl.addClass("hv_box_hide"), this.nodes.optDefi.removeClass("hover"), this.manager.evt.trigger("vjs_showInputPannel", !1))
            }, this), 5e3)
        }, showPannel: function () {
            this.parentEl.removeClass("hv_box_hide"), this.autoHidePannel(), this.manager.evt.trigger("vjs_showInputPannel", !0)
        }, hidePannel: function () {
            this.parentEl.addClass("hv_box_hide")
        }, toggleBarrgeInput: function (e) {
            this.hidePannel(), this.isShowInputBar = e.args[0]
        }, showLoading: function (e) {
            if (!this.playerData.config.supportP2P) {
                var t = this.manager.listener.get(r.PLAY_STATE);
                if ("vjs_stalled" == e.type && ("pause" == t || "init" == t || "ended" == t || "stop" == t || "changeDefi" == t))return
            }
            "vjs_seeking" == e.type ? this.nodes.loading[0].style.display = "block" : (clearTimeout(this.showLoadingTime), this.showLoadingTime = setTimeout(s.bind(function () {
                    this.nodes.loading[0].style.display = "block"
                }, this), 500))
        }, hideLoading: function (e) {
            if (!this.playerData.config.supportP2P) {
                var t = this.manager.listener.get(r.PLAY_STATE);
                if ("vjs_timeupdate" == e.type && "seeking" == t || this.isPcFullscreen)return
            }
            this.showLoadingTime && (clearTimeout(this.showLoadingTime), this.showLoadingTime = null), this.nodes.loading[0].style.display = "none"
        }, stopPropagation: function (e) {
            e.stopPropagation()
        }
    };
    s.merge(n.prototype, o), module.exports = n
}

